

Func Print($SplashStr)
	SplashTextOn ("ShopBot", $SplashStr & @LF , 290, 35, 550, 15, 1, "", 10)
	
EndFunc



; acc, ref. index 
Func SaveLastAcc($acc_idx)
	Local $file ;  

	Print("SaveLastAcc .. IN " & $acc_idx );
	$file = FileOpen("em_accmaker.state", 2)		; erase & write

	; Check if file opened for reading OK
	If $file = -1 Then
		MsgBox(0, "Error", "Unable to open file.")
		Exit
	EndIf
	; ref index, acc index. 
			;MsgBox(0, "Error", $storeDataAr[0] &  " " & $storeDataAr[1])
	; Write something to the file.
	FileWriteLine($file, $acc_idx)		; ref index
	;MsgBox(0, "FileWriteLine ", "$acc_idx" & $acc_idx )
	;FileWriteLine($file, $storeDataAr[1])		; acc index
	; Flush the file to disk.
	FileFlush($file)
	FileClose($file)

EndFunc   ;==>openLogFile

Func ReadLastAcc()
	Local $acc_idx ;
	Local $file
	$file = FileOpen("em_accmaker.state", 0)

	; Check if file opened for reading OK
	If $file = -1 Then
		MsgBox(0, "Error", "Unable to open file. create one")
			$file = FileOpen("em_accmaker.state", 1)
			FileWriteLine($file, 0)		; ref index
			FileWriteLine($file, 0)		; acc index
		;Exit
	EndIf

	; Read in lines of text until the EOF is reached
	;While 1
		$acc_idx = FileReadLine($file)	; horo
		 MsgBox(0, "ReadLastAcc ", "$acc_idx" & $acc_idx )
		;$DataArr[1] = FileReadLine($file)	;name
		;MsgBox(0, "Line read:", $DataArr[0] & " name " & $DataArr[1])
	;Wend
Print("ReadLastAcc .. out " & $acc_idx );
	FileClose($file)
	return $acc_idx
EndFunc

